package Bean;

import org.springframework.stereotype.Component;

@Component // 添加注解以将此类标记为Spring管理的Bean
public class Student {
    private String number;
    private String passworld;
    private String id;

    // 添加构造方法
    public Student(String number, String passworld, String id) {
        this.number = number;
        this.passworld = passworld;
        this.id = id;
    }

    // 省略getter和setter方法
    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getPassworld() {
        return passworld;
    }

    public void setPassworld(String passworld) {
        this.passworld = passworld;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "学生注册成功\n" +
                "账号:'" + number + '\'' +
                ", 密码:'" + passworld + '\'' +
                ", 身份:'" + id + '\'' ;
    }
}